<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增国家管理')" />
    <th:block th:include="include :: datetimepicker-css"/>
    <th:block th:include="include :: bootstrap-fileinput-css"/>
    <th:block th:include="include :: jquery-smartwizard-css"/>
    <th:block th:include="include :: select2-css"/>
    <th:block th:include="include :: bootstrap-select-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-country-add">
            <div class="form-group">
                <label class="col-sm-2 control-label">国家名称</label>
                <div class="col-sm-10">
                    <input name="name" class="form-control" placeholder="请输入标题" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">标题</label>
                <div class="col-sm-10">
                    <input name="title" class="form-control" placeholder="请输入标题" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">关键词</label>
                <div class="col-sm-10">
                    <input name="keyword" class="form-control" placeholder="请输入关键词" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">描述</label>
                <div class="col-sm-10">
                    <input name="description" class="form-control" placeholder="请输入描述" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">说明</label>
                <div class="col-sm-10">
                    <input name="illustrate" class="form-control" placeholder="请输入说明" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">内容</label>
                <div class="col-sm-10">
                    <input type="hidden" class="form-control" required>
                    <script id="content" name="content" type="text/plain"></script>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer"/>
    <th:block th:include="include :: datetimepicker-js"/>
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <th:block th:include="include :: jquery-smartwizard-js"/>
    <th:block th:include="include :: select2-js"/>
    <th:block th:include="include :: bootstrap-select-js"/>
    <script src="/ueditor/ueditor.config.js" type="text/javascript" charSet="utf-8"></script>
    <script src="/ueditor/ueditor.all.js" type="text/javascript" charSet="utf-8"></script>
    <script src="/ueditor/lang/zh-cn/zh-cn.js" type="text/javascript" charSet="utf-8"></script>

    <script th:inline="javascript">
        var prefix = ctx + "ydz/country"
        $("#form-country-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-country-add').serialize());
            }
        }

        $(function() {
            parent.$('body').find('.layui-layer-max:not(.layui-layer-maxmin)').click()

        });

        //富文本
        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
        UE.Editor.prototype.getActionUrl = function (action) {
            if (action == 'uploadimage' || action == 'uploadscrawl') {
                return '/common/upload';
            } else {
                return this._bkGetActionUrl.call(this, action);
            }
        }
        var ue = UE.getEditor('content', {
            autoHeightEnabled: false,//是否自动长高
            autoFloatEnabled: true,//是否保持toolbar的位置不动
            scaleEnabled: true,//是否可以拉伸长高
            initialFrameWidth: 'auto',//初始化编辑器宽度
            initialFrameHeight: 300,//初始化编辑器高度
        });
        ue.ready(function () {
        })
    </script>
</body>
</html>